#include<stdio.h>
#include<stdlib.h>

void incre(int *);

int main(){
	int i, m, count;
	int array[11];
	for(i = 1; i <= 10; i++){
		array[i] = 0;
	}

	printf("TTTTTTTTTTTTT");

	i = 1;
	m = 3;
	count = 10;
	while(count != 0){
		while(m != 0){
			if(array[i] == 0)
				m--;
			if(m == 0)
				break;
			incre(&i);
			
		}
		printf("%d  " ,i);
		--count;
		array[i] = 1;
		incre(&i);
		m = 3;
	}
}


void incre(int *i){
	if( *i == 10)
		*i = 1;
	else 
		(*i)++;
}
